package b;

/**
 * <BR>
 *
 *
 * VERSION        NAME        DATE        REASON
 * ----------------------------------------------------------------------------
 * 1.00           Brian       Mar 10, 2012  Create
 * @author brian
 * @version 1.00
 */
public class ByteUtil {

    /**
     * 通过下标删除字节.<BR>
     * 
     * @param bs
     * @param i
     * @return 删除后的字节数组
     */
    public static byte[] deleteAt(byte[] bs, int i) {

        int length = bs.length - 1;
        byte[] r = new byte[length];
        if (i == length) {
            System.arraycopy(bs, 0, r, 0, length);
        } else {
            for (int j = i; j < length; j++) {
                bs[j] = bs[j + 1];
            }
            System.arraycopy(bs, 0, r, 0, length);
        }
        return r;
    }
}
